package com.ch01.ex25;

/**
 * Created by zc on 2016/1/27.
 */
public class NumberObj {
    private int num;

    public NumberObj() {
        this.num = 5;
    }

    public synchronized void add(){
        num++;
    }

    public synchronized void sub(){
        num--;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
}
